import { PaginationProps } from '@/common/types'
import { String } from 'lodash';

export interface GetCreatedMcpListRes extends PaginationProps { }

export interface GetCreatedMcpListItem {
  id: string;
  templateId: string;
  name: string;
  avatar: string;
  description: string;
  type: string;
  updateTime: string;
  categoryCN: string;
  categories: string[];
  createUser: CreateUser;
  headerAuth: Record<string, any>;
  variables: Record<string, any>;
  avatar_images: string[];
  url: string;
  category: string;
  tutorialUrl: string;
  envSchema: EnvSchema;
}
export interface GetMcpServersListItem {
  id: string;
  teamId: string;
  name: string;
  tmbId: string;
  key: string;
  mcpServerConfig: McpServerConfig;
  apps: AppsData[];
  createUser: CreateUser;
}
export interface GetCreatedMcpServersItem {
  id: string;
  name: string;
  apps: AppsData[];
}

export interface GetCreatedTemplateItem {
  id: string;
  name: string;
  avatar: string;
  category: string;
  createTime: string;
  description: string;
  envSchema: EnvSchema;
  tutorialUrl: string;
  categoryCN: string;
}

export interface CreateUser {
  groupId: string;
  groupName: string;
  userId: string;
  userName: string;
}
export interface EnvSchema {
  properties: {
    [key: string]: {
      description: string;
      type: string;
    };
  };
  required: string[];
  type: 'object';
}
export interface McpServerConfig {
  SSE: config;
  StreamableHttp: config;
}

interface config {
  config: object;
  url: string;
}
export interface AppsData {
  appId: string;
  toolName: string;
  appName: string;
  description: string;
}
export interface GetCategoriesListRes {
  id?: string;
  type?: string;
  label: string;
  value: string;
}

export interface GetCreatedMcpListReq extends PaginationProps {
  list: GetCreatedMcpListItem[];
}

export interface CreateHeaderSecretReq {
  type: string;
  name: string;
  username: string;
  password?: string;
  value: string;
  customAuth: {
    key: string;
    value: string;
  }[];
}
export interface RunToolsParams {
  url: string;
  headerAuth: Record<string, any>;
  templateId: string;
  variables: Record<string, any>;
  toolName: string;
  params: Record<string, any>;
}

export interface CreateMcpParams {
  url?: string;
  headerAuth?: Record<string, any>;
  templateId?: string;
  variables?: Record<string, any>;
  id?: string;
  name?: string;
  avatar?: string;
  avatar_images?: any[];
  description?: string;
  category?: string;
  tools?: any[];
}